package com.linjacy.httpproject.config;

import org.apache.commons.lang3.StringUtils;

/**
 *  分表策略接口
 */
public interface ITableShardStrategy {
    /**
     * @param tableNamePrefix 表前缀名
     * @param value 值
     */
    String generateTableName(String tableNamePrefix, Object value);

    /**
     * 验证tableNamePrefix
     */
    default void verificationTableNamePrefix(String tableNamePrefix){
        if (StringUtils.isBlank(tableNamePrefix)) {
            throw new RuntimeException("tableNamePrefix is null");
        }
    }

}
